package com.example.demo.Admin;

import com.example.demo.DAO.UserDAO;
import com.example.demo.User.User;
import com.example.demo.User.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class AdminServiceImpl implements UserService {
    @Autowired
    private UserDAO userDAO;

    @Override
    public Boolean addUser(User user) {
        return userDAO.addUser(user);  // 添加用户
    }

    @Override
    public Boolean deleteUser(String userId, String password) {
        return null;
    }


    @Override
    public Boolean updateUser(User user) {
        return null;
    }

    @Override
    public List<User> findAllUser() {
        return userDAO.findAllUser();  // 查询所有用户
    }

    @Override
    public User findUserById(String id) {
        return userDAO.findUserById(id);  // 通过ID查询用户
    }

    @Override
    public User authenticate(String adminId, String password) {
        return null;
    }

    public Boolean approveUser(String userId) {
        return null;  // 审批用户
    }
}
